package com.cn.kabalifeuser.ui.order.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.cn.kabalifeuser.R;
import com.cn.kabalifeuser.ui.order.bean.OrderDetailsBean;
import com.cn.kabalifeuser.utils.GlideUtil;

import java.util.List;

/**
 * Created by 晓林 on 2020/9/22.
 * function:
 */
public class OrderDetailsAdapter extends BaseQuickAdapter<OrderDetailsBean.ResultBean.GoodsInfoBean, BaseViewHolder> {
    public OrderDetailsAdapter(int layoutResId, @Nullable List<OrderDetailsBean.ResultBean.GoodsInfoBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, OrderDetailsBean.ResultBean.GoodsInfoBean item) {

        helper.setGone(R.id.ll_context, true);
        GlideUtil.ImageLoad(this.mContext, item.getGood_img(), helper.getView(R.id.good_img));
        helper.setText(R.id.tv_title, item.getTitle())
                .setText(R.id.tv_spec_key, item.getSpec_key())
                .setText(R.id.tv_money, item.getMoney())
                .setText(R.id.tv_content, item.getContent())
                .setText(R.id.tv_good_num, "x " + item.getGood_num());
        if (item.getStatus() == 2) {

        }
    }
}
